function BackgroundClass(){
	  this.imgOne = new Image;
	  this.imgOne.src = "img/background.png";
	  this.imgTwo = new Image;
	  this.imgTwo.src = "img/background.png";
	  //背景图的y坐标
	  this.imgOneY = -canvas.height;
	  this.imgTwoY = 0;
	  //开始画背景
	  this.drawBack = function(){
	  	context.beginPath();
	  	context.drawImage(this.imgOne,0,this.imgOneY,canvas.width,canvas.height + 10);
	  	context.drawImage(this.imgTwo,0,this.imgTwoY,canvas.width,canvas.height + 10);
	  	context.save();
	  }
	  //背景开始滑动
	  this.backgroundMove = function(speed){
	  	this.imgOneY += speed;
	  	if(this.imgOneY >= canvas.height){
	  		this.imgOneY = -canvas.height;
	  	}
	  	this.imgTwoY += speed;
	  	//图片到底部的时候 再移动到最上边
	    if(this.imgTwoY >= canvas.height){
	     this.imgTwoY = -canvas.height;
	  	}
	    //绘制背景
	    this.drawBack();
	  }
}

